package com.wjw.controller;

/**
 * @author WuJianWei
 * @date 2022/3/21 11:12
 */

import com.wjw.service.BusinessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/business")
public class BusinessController {
    @Autowired
    private BusinessService businessService;
    @PostMapping(value = "/add-business")
    public Boolean addBusiness( @RequestBody Map<String, Object> map) {
        String businessName = map.get("businessName").toString();
        String businessPhone = map.get("businessPhone").toString();
        Integer userId = Integer.valueOf(map.get("userId").toString());

        return businessService.addBusiness(businessName,businessPhone,userId);
    }
}
